Optimal. Leaf size=132 \[ -\frac {(i a-b) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right )}{(a-i b)^{3/2} d}+\frac {(i a+b) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{(a+i b)^{3/2} d}-\frac {4 a b}{\left (a^2+b^2\right ) d \sqrt {a+b \cot (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 132, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {3610, 3620,
3618, 65, 214} \begin {gather*} -\frac {4 a b}{d \left (a^2+b^2\right ) \sqrt {a+b \cot (c+d x)}}-\frac {(-b+i a) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right )}{d (a-i b)^{3/2}}+\frac {(b+i a) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{d (a+i b)^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 214
Rule 3610
Rule 3618
Rule 3620
Rubi steps
\begin {align*} \int \frac {-a+b \cot (c+d x)}{(a+b \cot (c+d x))^{3/2}} \, dx &=-\frac {4 a b}{\left (a^2+b^2\right ) d \sqrt {a+b \cot (c+d x)}}+\frac {\int \frac {-a^2+b^2+2 a b \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx}{a^2+b^2}\\ &=-\frac {4 a b}{\left (a^2+b^2\right ) d \sqrt {a+b \cot (c+d x)}}-\frac {(a-i b) \int \frac {1-i \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx}{2 (a+i b)}-\frac {(a+i b) \int \frac {1+i \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx}{2 (a-i b)}\\ &=-\frac {4 a b}{\left (a^2+b^2\right ) d \sqrt {a+b \cot (c+d x)}}-\frac {(a+i b) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a-i b x}} \, dx,x,i \cot (c+d x)\right )}{2 (i a+b) d}-\frac {(i a+b) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a+i b x}} \, dx,x,-i \cot (c+d x)\right )}{2 (a+i b) d}\\ &=-\frac {4 a b}{\left (a^2+b^2\right ) d \sqrt {a+b \cot (c+d x)}}-\frac {(a-i b) \text {Subst}\left (\int \frac {1}{-1+\frac {i a}{b}-\frac {i x^2}{b}} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{(a+i b) b d}-\frac {(a+i b) \text {Subst}\left (\int \frac {1}{-1-\frac {i a}{b}+\frac {i x^2}{b}} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{(a-i b) b d}\\ &=-\frac {(i a-b) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right )}{(a-i b)^{3/2} d}+\frac {(i a+b) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{(a+i b)^{3/2} d}-\frac {4 a b}{\left (a^2+b^2\right ) d \sqrt {a+b \cot (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.58, size = 216, normalized size = 1.64 \begin {gather*} \frac {(a-b \cot (c+d x)) \left (-i (a+i b)^{5/2} \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right ) \sqrt {a+b \cot (c+d x)}+\sqrt {a-i b} \left (-4 a \sqrt {a+i b} b+i (a-i b)^2 \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right ) \sqrt {a+b \cot (c+d x)}\right )\right ) \sin (c+d x)}{(a-i b)^{3/2} (a+i b)^{3/2} d \sqrt {a+b \cot (c+d x)} (-b \cos (c+d x)+a \sin (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(927\) vs.
\(2(112)=224\).
time = 0.63, size = 928, normalized size = 7.03
method | result | size |
derivativedivides | \(-\frac {2 b \left (\frac {\frac {-\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{5}-2 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3} b^{2}-3 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{4}\right ) \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (6 a^{4} b^{2}+4 a^{2} b^{4}-2 b^{6}+\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{5}-2 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3} b^{2}-3 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{4}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}+\frac {\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{5}-2 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3} b^{2}-3 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{4}\right ) \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-6 a^{4} b^{2}-4 a^{2} b^{4}+2 b^{6}-\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{5}-2 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3} b^{2}-3 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{4}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}}{a^{2}+b^{2}}+\frac {2 a}{\left (a^{2}+b^{2}\right ) \sqrt {a +b \cot \left (d x +c \right )}}\right )}{d}\) | \(928\) |
default | \(-\frac {2 b \left (\frac {\frac {-\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{5}-2 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3} b^{2}-3 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{4}\right ) \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (6 a^{4} b^{2}+4 a^{2} b^{4}-2 b^{6}+\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{5}-2 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3} b^{2}-3 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{4}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}+\frac {\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{5}-2 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3} b^{2}-3 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{4}\right ) \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-6 a^{4} b^{2}-4 a^{2} b^{4}+2 b^{6}-\frac {\left (-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{4}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{5}-2 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3} b^{2}-3 \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{4}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}}{a^{2}+b^{2}}+\frac {2 a}{\left (a^{2}+b^{2}\right ) \sqrt {a +b \cot \left (d x +c \right )}}\right )}{d}\) | \(928\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \int \frac {a}{a \sqrt {a + b \cot {\left (c + d x \right )}} + b \sqrt {a + b \cot {\left (c + d x \right )}} \cot {\left (c + d x \right )}}\, dx - \int \left (- \frac {b \cot {\left (c + d x \right )}}{a \sqrt {a + b \cot {\left (c + d x \right )}} + b \sqrt {a + b \cot {\left (c + d x \right )}} \cot {\left (c + d x \right )}}\right )\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.96, size = 2500, normalized size = 18.94 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________